<template>
  <div class="progress-container">
    <div
        v-for="(item, index) in data"
        :key="index"
        class="progress-item"
    >
      <div class="progress-header">
        <span>{{ item.stage }}</span>
        <span>{{ item.progress }}%</span>
      </div>
      <el-progress
          :percentage="item.progress"
          :color="customColors"
          stroke-width="12"
      />
    </div>
  </div>
</template>

<script setup lang="ts">
const props = defineProps<{
  data: Array<{ stage: string; progress: number }>
}>()

const customColors = [
  { color: '#409eff', percentage: 20 },
  { color: '#67c23a', percentage: 40 },
  { color: '#e6a23c', percentage: 60 },
  { color: '#f56c6c', percentage: 80 }
]
</script>

<style scoped>
.progress-container {
  padding: 10px;
}

.progress-item {
  margin: 18px 0;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--el-text-color-regular);
}

.progress-header span:last-child {
  color: var(--el-color-primary);
}
</style>